home *** CD-ROM | disk | FTP | other *** search
- /*****************************************************************************\
- * *
- * Programmer: Eric E. Arneson CIS 76701,76 GEnie MS.ASSTSYOP *
- * *
- * Date: 1988-12-16 *
- * *
- * Procedure Name: int _maxlines(void) max lines of text on screen *
- * *
- * Discription: switches text mode to the max number of lines on screen *
- * on a 100% IBM EGA and EGA Display: 43 line mode *
- * on a 100% IBM VGA and VGA Display: 50 line mode *
- * *
- * Freeware! *
- * *
- \*****************************************************************************/
-
- #include <dos.h>
-
- #define CallVideoInt() result = int86x(0x10,&inregs, &outregs, &segregs)
-
- int maxlines(void); /* this line should to be in any subprogram, */
- /* making an "extern" call to _maxlines() */
-
- int _maxlines(void)
- {
- union REGS inregs,outregs;
- struct SREGS segregs;
- int result;
-
- inregs.x.ax = 0x1200; /* Get Config. Info. (Function 12h) */
- inregs.x.bx = 0xff10; /* Get Config. Info. (SubFunction 10h) */
- inregs.h.cl = 0x0f; /* Init. as a CGA 40x25 Secondary Adapter */
- CallVideoInt();
- if(outregs.h.cl < 0x0c) /* not set as a Secondary Adapter to an MDA */
- if(outregs.h.bh <= 0x01) /* Type of Display */
- if(outregs.h.bl <= 0x03) { /* Memory available on Adapter */
- inregs.x.ax = 0x0003; /* Put into Co80 */
- CallVideoInt();
- inregs.x.ax = 0x1112; /* Load ROM 8 by 8 Font */
- inregs.h.bl = 0x00; /* and Reprogram Controller */
- CallVideoInt();
- inregs.x.ax = 0x0100; /* Set Cursor Type */
- inregs.x.cx = 0x0407; /* Starting/Ending line for Cursor */
- CallVideoInt();
- inregs.x.ax = 0x1200; /* Select Alternate PrintScreen */
- inregs.x.bx = 0x0020;
- CallVideoInt();
- return(0); /* return 0 that means it was successful */
- }
- return(-1); /* return -1 that means it failed */
- }
-
- /******************************************\
- * *
- * This main() is only here for making this *
- * a stand alone program. *
- * *
- \******************************************/
- main()
- {
- _maxlines();
- }